Skip to content

LSP/Textmate: Implement multiview support for generic/textmate based syntax support#8080

Merged
matthiasblaesing merged 2 commits intoapache:masterfrom
matthiasblaesing:multiview_generic_lsp
Apr 6, 2025
Merged

LSP/Textmate: Implement multiview support for generic/textmate based syntax support#8080
matthiasblaesing merged 2 commits intoapache:masterfrom
matthiasblaesing:multiview_generic_lsp

Conversation

@matthiasblaesing
Copy link
Contributor

@matthiasblaesing matthiasblaesing commented Dec 20, 2024

Multiview support for example is utilized by per-file history:

grafik

In the screenshot a C# file is opened with the CSharp grammar loaded and the history of the file can be also added.

Closes: #5204

@matthiasblaesing matthiasblaesing added LSP [ci] enable Language Server Protocol tests ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Dec 20, 2024
@matthiasblaesing matthiasblaesing added this to the NB25 milestone Dec 20, 2024
@matthiasblaesing
Copy link
Contributor Author

@lahodaj would you mind having a look at this? I think multi-view is benefical for the generic lsp integration as that for example allows sane usage of git integration.

@ebarboni ebarboni modified the milestones: NB25, NB26 Jan 24, 2025
…t be parsed

After beea5ce (LSP/Textmate: Implement multiview support for
generic/textmate based syntax support) it was observed, that
occasionally an IllegalArgumentException was raised from the
MimeResolverImpl (see full stacktrace below). 

The error message indicates that the description file is not valid
anymore. This matches the renewal of the registration at startup.

Log this on info level, so that is not raised to users attention, as
for the LSP case, the updated file is available milliseconds later and
should regenerate the resolvers in the next iteration.


java.lang.IllegalArgumentException: MultiFileObject@d1d4bdb[Services/MIMEResolver/c.xml] parent: MultiFileObject@27ddc920[Services/MIMEResolver] validFlag: false validRoot: MultiFileObject@49354fe[root of SystemFileSystem[org.netbeans.core.startup.layers.SystemFileSystem@20cea7a4]] isValidRoot: true
                at org.netbeans.modules.openide.filesystems.declmime.MIMEResolverImpl.create(MIMEResolverImpl.java:344)
                at org.netbeans.modules.openide.filesystems.declmime.MIMEResolverImpl.forDescriptor(MIMEResolverImpl.java:67)
                at org.openide.filesystems.MIMESupport$CachedFileObject.declarativeResolvers(MIMESupport.java:256)
                at org.openide.filesystems.MIMESupport$CachedFileObject.getResolvers(MIMESupport.java:197)
                at org.openide.filesystems.MIMESupport$CachedFileObject.resolveMIME(MIMESupport.java:340)
                at org.openide.filesystems.MIMESupport$CachedFileObject.getMIMEType(MIMESupport.java:287)
                at org.openide.filesystems.MIMESupport.findMIMEType(MIMESupport.java:111)
                at org.openide.filesystems.FileUtil.getMIMEType(FileUtil.java:1388)
                at org.openide.filesystems.FileObject.getMIMEType(FileObject.java:642)
                at org.openide.filesystems.AbstractFileObject.getMIMEType(AbstractFileObject.java:169)
                at org.openide.filesystems.MultiFileObject.getMIMEType(MultiFileObject.java:623)
                at org.openide.filesystems.MultiFileObject.getMIMEType(MultiFileObject.java:623)
                at org.openide.loaders.DataLoaderPool.allLoaders(DataLoaderPool.java:307)
                at org.openide.loaders.DataLoaderPool.findDataObject(DataLoaderPool.java:505)
[catch] at org.openide.loaders.FolderList.createBoth(FolderList.java:743)
                at org.openide.loaders.FolderList.getObjects(FolderList.java:539)
                at org.openide.loaders.FolderList.access$600(FolderList.java:52)
                at org.openide.loaders.FolderList$ListTask.computeResult(FolderList.java:938)
                at org.openide.loaders.FolderList$ListTask.run(FolderList.java:914)
                at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403)
                at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
                at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
                at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2018)
@matthiasblaesing
Copy link
Contributor Author

I intent to merge this by of this week. If anyone wants to object, please do so now.

@matthiasblaesing
Copy link
Contributor Author

Hearing no objections, lets get this in.

@matthiasblaesing matthiasblaesing merged commit 16bd611 into apache:master Apr 6, 2025
31 checks passed
@matthiasblaesing matthiasblaesing deleted the multiview_generic_lsp branch April 9, 2025 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) LSP [ci] enable Language Server Protocol tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MultiView support for textmate registered files are missing

2 participants

Comments